mob
	player
		New()
			..()
			spawn()
				load_settings()

		Logout()
			save_settings()
			..()

		proc
			load_settings()
				//TURN
				if(fexists("saves/settings/turn.txt"))
					var/txtfile = file("saves/settings/turn.txt")
					turn = text2num(file2text(txtfile))

				//speed up
				if(fexists("saves/settings/speedup.txt"))
					var/txtfile = file("saves/settings/speedup.txt")
					speedup = text2num(file2text(txtfile))

			save_settings()
				var/txtfile

				//TURN
				if(fexists("saves/settings/turn.txt")) fdel("saves/settings/turn.txt")
				txtfile = file("saves/settings/turn.txt")
				txtfile << turn

				//speed up
				if(fexists("saves/settings/speedup.txt")) fdel("saves/settings/speedup.txt")
				txtfile = file("saves/settings/speedup.txt")
				txtfile << speedup

			// 0 for off
			// 1 >  for on
		var
			turn = 1
			sound = 1
			speedup = 0


		proc
			setting_form()
				winset(src, "settings.btn_turn", "text=[turn > 0 ? "On" : "Off"]")
				winset(src, "settings.btn_sound", "text=[sound > 0 ? "On" : "Off"]")
				winset(src, "settings.btn_speedup", "text=[speedup > 0 ? "On" : "Off"]")
				winshow(src,"settings",1)

		verb
			toggle_speedup()
				set name = "toggle_speedup"
				if(speedup > 0)
					speedup = 0
				else
					speedup = 1
				winset(src, "settings.btn_speedup", "text=[speedup > 0 ? "On" : "Off"]")

			toggle_sound()
				set name = "toggle_sound"
				if(sound > 0)
					sound = 0
				else
					sound = 1
				winset(src, "settings.btn_sound", "text=[sound > 0 ? "On" : "Off"]")

			toggle_turn()
				set name = "toggle_turn"
				if(turn > 0)
					turn = 0
				else
					turn = 1
				winset(src, "settings.btn_turn", "text=[turn > 0 ? "On" : "Off"]")

